<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let obj = {
            name: "老王",
            age: 18,
            sex: "男",
            like: ["篮球", {
                name: "蹦极"
            }, "跳", "rap"],
            run: function() {
                console.log("跑了");
            }
        }

        // 缺点：不能复制 函数！
        let obj2 = JSON.parse(JSON.stringify(obj));

        obj2.like[0] = "飞";

        obj2.like[1].name = '跳伞';
        console.log(obj);
        console.log(obj2);
    </script>
</body>

</html>